package com.jyw.business.ins.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jyw.business.ins.domain.InsPlanExecutionTime;
import com.jyw.business.ins.mapper.InsPlanExecutionTimeMapper;
import com.jyw.business.ins.service.IInsPlanExecutionTimeService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 巡检计划执行时间Service业务层处理
 *
 * @author system
 * @date 2023-10-07
 */
@Service
public class InsPlanExecutionTimeServiceImpl extends ServiceImpl<InsPlanExecutionTimeMapper, InsPlanExecutionTime> implements IInsPlanExecutionTimeService {
    @Resource
    private InsPlanExecutionTimeMapper insPlanExecutionTimeMapper;

    /**
     * 查询巡检计划执行时间
     *
     * @param id 巡检计划执行时间主键
     * @return 巡检计划执行时间
     */
    @Override
    public InsPlanExecutionTime selectInsPlanExecutionTimeById(Long id) {
        return insPlanExecutionTimeMapper.selectInsPlanExecutionTimeById(id);
    }

    @Override
    public List<InsPlanExecutionTime> selectByPlanId(Long planId) {
        QueryWrapper<InsPlanExecutionTime> queryWrapper = new QueryWrapper<>();
        queryWrapper.lambda().eq(InsPlanExecutionTime::getPlanId,planId);
        return this.list(queryWrapper);
    }

    /**
     * 查询巡检计划执行时间列表
     *
     * @param insPlanExecutionTime 巡检计划执行时间
     * @return 巡检计划执行时间
     */
    @Override
    public List<InsPlanExecutionTime> selectInsPlanExecutionTimeList(InsPlanExecutionTime insPlanExecutionTime) {
        return insPlanExecutionTimeMapper.selectInsPlanExecutionTimeList(insPlanExecutionTime);
    }

    /**
     * 新增巡检计划执行时间
     *
     * @param insPlanExecutionTime 巡检计划执行时间
     * @return 结果
     */
    @Override
    public int insertInsPlanExecutionTime(InsPlanExecutionTime insPlanExecutionTime) {
        return insPlanExecutionTimeMapper.insertInsPlanExecutionTime(insPlanExecutionTime);
    }

    /**
     * 修改巡检计划执行时间
     *
     * @param insPlanExecutionTime 巡检计划执行时间
     * @return 结果
     */
    @Override
    public int updateInsPlanExecutionTime(InsPlanExecutionTime insPlanExecutionTime) {
        return insPlanExecutionTimeMapper.updateInsPlanExecutionTime(insPlanExecutionTime);
    }

    @Override
    public int deleteByPlanId(Long planId) {
        return insPlanExecutionTimeMapper.deleteByPlanId(planId);
    }

    /**
     * 批量删除巡检计划执行时间
     *
     * @param ids 需要删除的巡检计划执行时间主键
     * @return 结果
     */
    @Override
    public int deleteInsPlanExecutionTimeByIds(Long[] ids) {
        return insPlanExecutionTimeMapper.deleteInsPlanExecutionTimeByIds(ids);
    }

    /**
     * 删除巡检计划执行时间信息
     *
     * @param id 巡检计划执行时间主键
     * @return 结果
     */
    @Override
    public int deleteInsPlanExecutionTimeById(Long id) {
        return insPlanExecutionTimeMapper.deleteInsPlanExecutionTimeById(id);
    }
}
